<?php

    require_once dirname(dirname(__FILE__)) . '/config/config.php';
    require_once DOCUMENT_ROOT . DIR_SHARED_DAO . 'dao_transaction.php';

    /**
     * User: Viet Anh
     * Date: 06/06/2014
     * Time: 18:09
     */
    class api_transaction
    {
        public static function spend_transaction($user_id, $description, $amount)
        {
            $dao_transaction = new dao_transaction();

            return $dao_transaction->insert_transaction_history($user_id, $description, 3, $amount, 0, "", "");
        }

        public static function receive_transaction($user_id, $description, $amount)
        {
            $dao_transaction = new dao_transaction();

            return $dao_transaction->insert_transaction_history($user_id, $description, 4, $amount, 0, "", "");
        }

        public static function deposit_transaction($user_id, $description, $amount, $method_id, $card_number, $transaction_email)
        {
            $dao_transaction = new dao_transaction();

            return $dao_transaction->insert_transaction_history($user_id, $description, 2, $amount, $method_id, $card_number, $transaction_email);
        }
        
        public static function get_list_transaction_of_user($user_id)
        {
            $dao_transaction = new dao_transaction();

            return $dao_transaction->get_list_transaction_of_user($user_id);
        }
    }